<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>hello</title>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
    </script>
</head>
<body>

<h1 id="reset"></h1>

<script>

    window.onload = function () {
        var token = getCookie("token")
        if (token != null && token != '') {
            $.ajax({
                url: 'http://127.0.0.1/api/user/info/' + token,
                success: function (result) {
                    $("#reset").html(result + ",欢迎登录系统")
                }
            })
        } else {
            window.location.href = "http://127.0.0.1/static/login.html";
        }
    }

    function getCookie(cname) {
        var name = cname + "=";
        var ca = document.cookie.split(';');
        for (var i = 0; i < ca.length; i++) {
            var c = ca[i].trim();
            if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
        }
        return "";
    }
</script>
</body>
</html>